Skip to content

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Sep 17, 2025

No description provided.

@mnocon mnocon force-pushed the IBX-9737-criterions branch from 81df162 to 7d21645 Compare September 17, 2025 08:54
Copy link

github-actions bot commented Sep 17, 2025

Copy link
Contributor

@ciastektk ciastektk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all Criterion suffix from criteria name

Copy link
Contributor Author

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composite criterions are for grouping criteria together (it might seem counter intuitive, but it makes sense in the end). Please check also my comment on Slack

Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/collaboration/src/Query/Search.php


code_samples/collaboration/src/Query/Search.php

docs/search/collaboration_search_reference/collaboration_criteria.md@47:```php hl_lines="12-16"
docs/search/collaboration_search_reference/collaboration_criteria.md@48:[[= include_file('code_samples/collaboration/src/Query/Search.php') =]]
docs/search/collaboration_search_reference/collaboration_criteria.md@49:```

001⫶<?php
002⫶declare(strict_types=1);
003⫶
004⫶use Ibexa\Contracts\Collaboration\Session\Query\Criterion;
005⫶use Ibexa\Contracts\Collaboration\Session\Query\SortClause;
006⫶use Ibexa\Contracts\Collaboration\Session\SessionQuery;
007⫶use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;
008⫶use Ibexa\Contracts\CoreSearch\Values\Query\SortClause\FieldValueSortClause;
009⫶
010⫶$lastWeek = new DateTimeImmutable('-7 days');
011⫶$query = new SessionQuery(
012❇️ new Criterion\LogicalAnd(
013❇️ new Criterion\IsActive(true),
014❇️ new Criterion\Type('content'),
015❇️ new Criterion\CreatedAt($lastWeek, FieldValueCriterion::COMPARISON_GTE),
016❇️ ),
017⫶ [
018⫶ new SortClause\CreatedAt(FieldValueSortClause::SORT_DESC),
019⫶ ]
020⫶);
021⫶/** @var \Ibexa\Contracts\Collaboration\SessionServiceInterface $sessionService */
022⫶$sessionList = $sessionService->findSessions($query);

docs/search/collaboration_search_reference/collaboration_sort_clauses.md@34:```php hl_lines="18"
docs/search/collaboration_search_reference/collaboration_sort_clauses.md@35:[[= include_file('code_samples/collaboration/src/Query/Search.php') =]]
docs/search/collaboration_search_reference/collaboration_sort_clauses.md@36:```

001⫶<?php
002⫶declare(strict_types=1);
003⫶
004⫶use Ibexa\Contracts\Collaboration\Session\Query\Criterion;
005⫶use Ibexa\Contracts\Collaboration\Session\Query\SortClause;
006⫶use Ibexa\Contracts\Collaboration\Session\SessionQuery;
007⫶use Ibexa\Contracts\CoreSearch\Values\Query\Criterion\FieldValueCriterion;
008⫶use Ibexa\Contracts\CoreSearch\Values\Query\SortClause\FieldValueSortClause;
009⫶
010⫶$lastWeek = new DateTimeImmutable('-7 days');
011⫶$query = new SessionQuery(
012⫶ new Criterion\LogicalAnd(
013⫶ new Criterion\IsActive(true),
014⫶ new Criterion\Type('content'),
015⫶ new Criterion\CreatedAt($lastWeek, FieldValueCriterion::COMPARISON_GTE),
016⫶ ),
017⫶ [
018❇️ new SortClause\CreatedAt(FieldValueSortClause::SORT_DESC),
019⫶ ]
020⫶);
021⫶/** @var \Ibexa\Contracts\Collaboration\SessionServiceInterface $sessionService */
022⫶$sessionList = $sessionService->findSessions($query);

Download colorized diff

@julitafalcondusza julitafalcondusza merged commit f0dcb62 into 5.0 Oct 16, 2025
6 of 7 checks passed
@julitafalcondusza julitafalcondusza deleted the IBX-9737-criterions branch October 16, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants